import java.io.*;

public class runtime {
    public static void main(String[] args) throws Exception {
        Runtime runtime = Runtime.getRuntime();
        Process ipconfig = runtime.exec("ipconfig");
        //Process ipconfig = runtime.exec("ping www.baidu.com");
        ipconfig.waitFor();
        InputStream inputStream = ipconfig.getInputStream();

        byte[] bytes = new byte[1024];
        int len = 0;
        while ((len = inputStream.read(bytes)) != -1) {
            System.out.println(new String(bytes,0,len,"GBK"));
        }
    }
}
